<script>
    //es6如何定义变量，定义变量的特点
    //js定义 var a = 10;
    //es6写法定义变量，使用关键字 let let a= 10
    //let定义变量有作用范围
    //var没有作用范围
    //1.创建代码块，定义变量
    {
        var a =10
        let b =20
    }
    //2.在代码块外输出
    console.log(a)
    console.log(b)//Uncaught ReferenceError: b is not defined

    var a = 1
    var a = 2

    let m = 1
    let m = 2
    console.log(a)
    console.log(m)//Uncaught SyntaxError: Identifier 'm' has already been declared

</script>